package net.elive.server;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;
import javax.swing.JTextArea;

import net.elive.utils.LocationUtils;

public class Server implements ActionListener, WindowListener {

	private JFrame jframe;
	private JTextArea jtextArea;
	private int row;
	

	public static void main(String[] args) {
		new Server();
	}

	public Server() {
		new Config(this);
		jframe = new JFrame("中心服务器");
		jframe.setSize(500, 400);
		/**
		 * 窗口居中
		 */
		LocationUtils.centerWindow(jframe);
		jtextArea=new JTextArea();
		jframe.add(jtextArea);
		jframe.setVisible(true);
	}
	
	/**
	 * 输出信息到中心服务器端̨
	 * @param str
	 */
	public void println(String str){
		if(jtextArea!=null){
			if(row >100){
				jtextArea.setText("");
				row=0;
			}
		}
	}
	@Override
	public void windowOpened(WindowEvent e) {

	}

	@Override
	public void windowClosing(WindowEvent e) {

	}

	@Override
	public void windowClosed(WindowEvent e) {

	}

	@Override
	public void windowIconified(WindowEvent e) {

	}

	@Override
	public void windowDeiconified(WindowEvent e) {

	}

	@Override
	public void windowActivated(WindowEvent e) {

	}

	@Override
	public void windowDeactivated(WindowEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub

	}

}
